package main

func maxsubchuan(str string) int {
	m := map[rune]int{}
	i := 0
	max := 0
	for k,v := range str{
		if c,d := m[v];d && c >=i {
			i = c+1
		}
		m[v]=k
		if k-i+1 > max{
			max = k-i+1
		}
	}
	return max
}
